package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.pojo.CheckItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckItemDao {

    @Select("select * from t_checkitem")
    List<CheckItem> findAll();

    Page<CheckItem> findPage(QueryPageBean queryPageBean);

    void add(CheckItem checkItem);

    @Delete("delete from t_checkitem where id = #{id}")
    void deleteById(Integer id);

    void update(CheckItem checkItem);

    @Select("select checkitem_id from t_checkgroup_checkitem where checkgroup_id = #{checkgroupId}")
    List<Integer> findCheckItemIdsByCheckGroupId(Integer checkgroupId);

    @Select("select * from t_checkitem where id = #{id}")
    CheckItem findById(Integer id);
}
